package me.sealer.ssm.token;

/**
 * 功能描述： $ TokenImpl
 *
 * @author sealer
 * @email 1178884049@qq.com
 * @date 2019年12月02日 12时29分19秒
 */

import java.util.HashMap;
import java.util.Map;

public class TokenImpl implements Token {
    private static final long serialVersionUID = 9000877746955702825L;

    private String uniqueId;
    private long createDate;

    private Map properties = new HashMap();

    public TokenImpl(String uniqueId, long createDate) {
        this.uniqueId = uniqueId;
        this.createDate = createDate;
    }

    @Override
    public String toString() {
        return this.getClass().getName() + " :" + this.uniqueId + " " + this.createDate;
    }

    @Override
    public long getCreateDate() {
        return this.createDate;
    }

    @Override
    public String getUniqueId() {
        return this.uniqueId;
    }

    @Override
    public void setProperties(Map properties) {
        this.properties = properties;
        if (this.properties == null) {
            this.properties = new HashMap(16);
        }
    }

    @Override
    public Map getProperties() {
        return this.properties;
    }
}
